from django.db import models
from django.db import models
import datetime
from django.utils import timezone

class book(models.Model):
	title = models.CharField(max_length=200)
	authod = models.CharField(max_length=200)
	description = models.TextField()
	image = models.ImageField(upload_to = 'books/images/')
	review = models.TextField(blank = True)
	recommendation_score = models.IntegerField(default=0)
	
	def __str__(self):
		return self.book_text
		
	def was_published_recently(self):
		return self.pub_date >= timezone.now() - datetime.timedelta(days=1)